#ifndef  OBJECTTEST_H
#define  OBJECTTEST_H


#include "gtest/gtest.h"
#include "helper/object/ObjectInterface.h"

class ObjectTest : public testing::Test {
public:
    ObjectTest() :objFactory(nullptr){}

    void SetUp() override {
        objFactory = helper::object::DefaultObjectFactory::instance().getPtr();
    }
    void TearDown() override {
    }

    helper::object::ObjectFactory * getObjectFactory(){
        return objFactory;
    }
    template<typename T>
    void testClear(T * obj){
        obj->clear(); 
        ASSERT_EQ(0ul, obj->size());
    }
    template<typename T>
    void testNextOutOfRange(T * obj){
        auto it = obj->iterator();
        ASSERT_FALSE(it->hasNext());

        auto & value = it->next();
        ASSERT_TRUE(it->isEnd(value));
    }

private: 
    helper::object::ObjectFactory * objFactory;
};

#endif   /* OBJECTTEST_H */
